<template>
  <div>
    <v-viewer ref="view"></v-viewer>
    <div class="customer-area">
      <div class="title">
        <div class="point"></div>
        <span>产品信息</span>
      </div>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>区域</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.cityNamesSt | joinArray(productDetail.cityNames)}}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>金融产品公司全称</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.companyName }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>方案名称</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.productName }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>融资额区间</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.loanLower||0 }} —— {{ productDetail.loanUpper||0 }}元</span>
        </el-col>
      </el-row>
      <el-row :gutter="10"
              v-if="productDetail.pledgeRate">
        <el-col :span="3">
          <div class="content-title">
            <span>质押率</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.pledgeRate }}%</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>首付比例</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.downpayRatio }}%</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>GPS</span>
          </div>
        </el-col>
        <el-col v-if="productDetail.gpsType==='1'"
                :span="19">
          <el-row>
            <el-col>
              <span>可融
                <template v-if="productDetail.gpsFinanceRate">
                  ，可融比{{ productDetail.ifinanceRate }}%
                </template>
              </span>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="20">
              <el-tabs v-model="gpsTabValue"
                       type="border-card">
                <el-tab-pane v-for="(item, index) in gpsTabs"
                             :key="index"
                             :name="item.index">
                  <template slot="label">
                    <div class="tab-label">
                      <span>{{item.loanLower}}元~{{item.loanUpper}}元</span>
                    </div>
                  </template>
                  <template v-for="(gpsItem, key) in item.gpsLoop">
                    <el-col :key="key">
                      <span>{{gpsItem.quota}}元&nbsp;返&nbsp;{{gpsItem.gpsReturn}}元</span>
                    </el-col>
                  </template>
                </el-tab-pane>
              </el-tabs>
            </el-col>
          </el-row>
        </el-col>
        <el-col v-else
                :span="19">
          <span>不可融&nbsp;&nbsp;{{ productDetail.gpsQuota }}元</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>保险</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span v-if="productDetail.insuranceType === '1'">可融
            <template v-if="productDetail.ifinanceRate">
              ，可融比{{ productDetail.ifinanceRate }}%
            </template>
          </span>
          <span v-else>不可融</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>购置税</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span v-if="productDetail.purchaseTaxType === '1'">可融
            <template v-if="productDetail.ptfinanceRate">
              ，可融比{{ productDetail.ptfinanceRate }}%
            </template>
            <template v-if="productDetail.balanceRate">
              ，结算费率{{ productDetail.balanceRate }}%
            </template>
          </span>
          <span v-else>不可融</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>产品信用等级</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.grade }}级</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>资质要求</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.qualify | joinArray(productDetail.qualify) }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>牌照</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.licenseTag | joinArray(productDetail.licenseTags) }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>分期</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.period }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="20"
                :push="3">
          <el-tabs type="border-card">
            <el-tab-pane v-for="(item, index) in periodTabs"
                         :key="index"
                         :name="item.index">
              <template slot="label">
                <span>{{item.period}}</span>
              </template>
              <el-row>
                <el-col :span="2">
                  <div class="content-title">
                    <span>成本利率</span>
                  </div>
                </el-col>
                <el-col :span="22">
                  <div :key="key"
                       class="rate-area"
                       v-for="(rateItem, key) in item.rateLoop">
                    <span>展示利率：{{ rateItem.showRate }}%，成本利率：{{ rateItem.interestRate }}%&nbsp;返车商经济人：&nbsp;{{ rateItem.internalRatio }}%&nbsp;/反平台：&nbsp;{{rateItem.returnPlatform || 0 }}%</span>
                  </div>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="2">
                  <div class="content-title">
                    <span>服务费</span>
                  </div>
                </el-col>
                <el-col v-if="item.serviceChargeType==2"
                        :span="22">
                  <el-row v-if="item.sCFinanceRate">
                    <el-col class="rate-area">
                      <span>可融比{{item.sCFinanceRate}}%</span>
                    </el-col>
                  </el-row>
                  <el-row v-if="item.serviceChargeRide">
                    <el-col class="rate-area">
                      <span v-if="item.serviceChargeRide == 1">乘以车辆贷款额</span>
                      <span v-if="item.serviceChargeRide == 2">乘以车辆销售价</span>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col class="rate-area"
                            v-for="(chargeItem, key) in item.chargeLoop"
                            :key="key">
                      <span>
                        {{ chargeItem.lower }}元&nbsp;~&nbsp;{{ chargeItem.upper }}元
                        <template v-if="chargeItem.quota">，定额上限{{chargeItem.quota}}元</template>
                        <template v-if="chargeItem.percentage">，百分比上限{{chargeItem.percentage}}%</template>
                        <template v-if="chargeItem.min == true">两者取最小值</template>
                        <template v-if="chargeItem.min == false">两者取最大值</template>
                        <template v-if="chargeItem.platformQuota || chargeItem.platformPercentage">，返平台服务费：</template>
                        <template v-if="chargeItem.platformQuota">{{chargeItem.platformQuota}}元</template>
                        <template v-if="chargeItem.platformPercentage">{{chargeItem.platformPercentage}}%</template>
                        <template v-if="chargeItem.bigQuota || chargeItem.bigPercentage">，返大客户服务费：</template>
                        <template v-if="chargeItem.bigQuota">{{chargeItem.bigQuota}}元</template>
                        <template v-if="chargeItem.bigPercentage">{{chargeItem.bigPercentage}}%</template>
                      </span>
                    </el-col>
                  </el-row>
                </el-col>
                <el-col v-else
                        :span="19">
                  <span>无</span>
                </el-col>
              </el-row>
              <el-row v-if="item.preDeduction">
                <el-col :span="2">
                  <div class="content-title">
                    <span>前置扣息</span>
                  </div>
                </el-col>
                <el-col :span="22">
                  <el-row>
                    <el-col class="rate-area">
                      <span v-if="item.preDeductionType == 1">乘以总贷款额</span>
                      <span v-if="item.preDeductionType == 2">乘以车辆贷款</span>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col class="rate-area">
                      <span>{{ item.preDeduction }}%<template v-if="item.preDeductionReturn">&nbsp;返&nbsp;{{ item.preDeductionReturn }}%</template></span>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>
            </el-tab-pane>
          </el-tabs>
        </el-col>
      </el-row>
      <el-row :gutter="10"
              v-if="productDetail.signQuota">
        <el-col :span="3">
          <div class="content-title">
            <span>单双签额度</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.signQuota }}元</span>
        </el-col>
      </el-row>
      <el-row :gutter="10"
              v-if="productDetail.singleSign">
        <el-col :span="3">
          <div class="content-title">
            <span>单签所需材料</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.singleSign | joinArray(productDetail.singleSign) }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10"
              v-if="productDetail.doubleSign">
        <el-col :span="3">
          <div class="content-title">
            <span>双签所需材料</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.doubleSign | joinArray(productDetail.doubleSign) }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>提前还款</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.earlyRepayment }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>产品优势</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.advantage }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>备注</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.qualifications }}</span>
        </el-col>
      </el-row>
      <el-row v-for="(item, fileKey) in fileAllList"
              :key="fileKey"
              :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>{{item.explain}}</span>
          </div>
        </el-col>
        <el-col :span="19">
          <el-col>
            <span>{{ item.name }}</span>
            <a :href="item.filePath"
               target="_blank">下载</a>
          </el-col>
          <el-col v-if="item.exampleLoop && item.exampleLoop.length > 0">
            <el-col :span="3"
                    v-for="(ele, exmKey) in item.exampleLoop"
                    :key="exmKey">
              <pic-view :pic-url-list.sync="ele.urls"
                        upload-class="short-upload"
                        :pic-name-list.sync="ele.names"
                        :max-size="1"
                        @showImg="showImg"></pic-view>
              <div class="stalker">
                <span>{{ ele.display }}</span>
              </div>
            </el-col>
          </el-col>
        </el-col>
      </el-row>
      <el-row v-for="item in videoAllList"
              :key="item.dataAttrId"
              :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>{{item.explain}}</span>
          </div>
        </el-col>
        <template v-if="item.videoList">
          <div v-for="(videoItem, index) in item.videoList"
               :key="index"
               class="upload-video">
            <video :src="videoItem.url"
                   class="avatar video-avatar"
                   controls="controls">您的浏览器不支持视频播放</video>
          </div>
        </template>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="2">
          <div class="content-title">
            <span>业务审核流程</span>
          </div>
        </el-col>
        <el-col :span="19">
          <el-steps :active="productDetail.processList?productDetail.processList.length:1"
                    align-center>
            <el-step v-for="(item, key) in productDetail.processList"
                     :key="key"
                     :title="item.label"
                     :description="item.mark">
            </el-step>
          </el-steps>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>业务类型</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span v-if="productDetail.sufProcessType == 1">先放款后抵押</span>
          <span v-if="productDetail.sufProcessType == 2">先抵押后放款</span>
          <span v-if="productDetail.sufProcessType == 3">快速放款</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>审核步骤</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span v-if="productDetail.examineType == 1">一次审核</span>
          <span v-if="productDetail.examineType == 2">二次审核</span>
        </el-col>
      </el-row>
      <el-row v-if="productDetail.examineType != 1"
              :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>初审资料</span>
          </div>
        </el-col>
        <el-col :span="20">
          <el-collapse accordion>
            <el-collapse-item>
              <template slot="title">
                <div class="collapse-item-title"><span>主贷人材料</span></div>
              </template>
              <div v-for="(item, key) in productDetail.firstAttrsList"
                   :key="key">
                <el-col class="checkbox-item"
                        :span="4"
                        v-if="productMaterial.mainLender.some(a=>a.dataAttrId== JSON.parse(item).dataAttrId)">
                  <span>{{ productMaterial.mainLender.filter(a=>a.dataAttrId== JSON.parse(item).dataAttrId)[0]['name'] }}</span>
                </el-col>
              </div>
            </el-collapse-item>
            <el-collapse-item>
              <template slot="title">
                <div class="collapse-item-title"><span>配偶材料</span></div>
              </template>
              <div v-for="(item, key) in productDetail.firstAttrsList"
                   :key="key">
                <el-col class="checkbox-item"
                        :span="4"
                        v-if="productMaterial.mateLender.some(a=>a.dataAttrId== JSON.parse(item).dataAttrId)">
                  <span>{{ productMaterial.mateLender.filter(a=>a.dataAttrId== JSON.parse(item).dataAttrId)[0]['name'] }}</span>
                </el-col>
              </div>
            </el-collapse-item>
            <el-collapse-item>
              <template slot="title">
                <div class="collapse-item-title"><span>担保人材料</span></div>
              </template>
              <div v-for="(item, key) in productDetail.firstAttrsList"
                   :key="key">
                <el-col class="checkbox-item"
                        :span="4"
                        v-if="productMaterial.guarantorLender.some(a=>a.dataAttrId== JSON.parse(item).dataAttrId)">
                  <span>{{ productMaterial.guarantorLender.filter(a=>a.dataAttrId== JSON.parse(item).dataAttrId)[0]['name'] }}</span>
                </el-col>
              </div>
            </el-collapse-item>
            <el-collapse-item>
              <template slot="title">
                <div class="collapse-item-title"><span>担保人配偶材料</span></div>
              </template>
              <div v-for="(item, key) in productDetail.firstAttrsList"
                   :key="key">
                <el-col class="checkbox-item"
                        :span="4"
                        v-if="productMaterial.guarantorMateLender.some(a=>a.dataAttrId== JSON.parse(item).dataAttrId)">
                  <span>{{ productMaterial.guarantorMateLender.filter(a=>a.dataAttrId== JSON.parse(item).dataAttrId)[0]['name'] }}</span>
                </el-col>
              </div>
            </el-collapse-item>
          </el-collapse>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>分档资料</span>
          </div>
        </el-col>
        <el-col :span="20">
          <el-tabs v-model="dataTabsValue"
                   type="border-card">
            <el-tab-pane v-for="(item, index) in loanTabs"
                         :key="index"
                         :name="item.name">
              <template slot="label">
                <span>{{item.loanLower}}元~{{item.loanUpper}}元</span>
              </template>
              <el-form>
                <el-form-item label="终审资料">
                  <el-col :span="22">
                    <el-collapse accordion>
                      <el-collapse-item>
                        <template slot="title">
                          <div class="collapse-item-title"><span>主贷人材料</span></div>
                        </template>
                        <div v-for="(i, k) in item.lastAttrsList"
                             :key="k">
                          <el-col class="checkbox-item"
                                  :span="4"
                                  v-if="productMaterial.mainLender.some(a=>a.dataAttrId== JSON.parse(i).dataAttrId)">
                            <span>{{ productMaterial.mainLender.filter(a=>a.dataAttrId== JSON.parse(i).dataAttrId)[0]['name'] }}</span>
                          </el-col>
                        </div>
                      </el-collapse-item>
                      <el-collapse-item>
                        <template slot="title">
                          <div class="collapse-item-title"><span>配偶材料</span></div>
                        </template>
                        <div v-for="(i, k) in item.lastAttrsList"
                             :key="k">
                          <el-col class="checkbox-item"
                                  :span="4"
                                  v-if="productMaterial.mateLender.some(a=>a.dataAttrId== JSON.parse(i).dataAttrId)">
                            <span>{{ productMaterial.mateLender.filter(a=>a.dataAttrId== JSON.parse(i).dataAttrId)[0]['name'] }}</span>
                          </el-col>
                        </div>
                      </el-collapse-item>
                      <el-collapse-item>
                        <template slot="title">
                          <div class="collapse-item-title"><span>担保人材料</span></div>
                        </template>
                        <div v-for="(i, k) in item.lastAttrsList"
                             :key="k">
                          <el-col class="checkbox-item"
                                  :span="4"
                                  v-if="productMaterial.guarantorLender.some(a=>a.dataAttrId== JSON.parse(i).dataAttrId)">
                            <span>{{ productMaterial.guarantorLender.filter(a=>a.dataAttrId== JSON.parse(i).dataAttrId)[0]['name'] }}</span>
                          </el-col>
                        </div>
                      </el-collapse-item>
                      <el-collapse-item>
                        <template slot="title">
                          <div class="collapse-item-title"><span>担保人配偶材料</span></div>
                        </template>
                        <div v-for="(i, k) in item.lastAttrsList"
                             :key="k">
                          <el-col class="checkbox-item"
                                  :span="4"
                                  v-if="productMaterial.guarantorMateLender.some(a=>a.label == k)">
                            <span>{{ productMaterial.guarantorMateLender.filter(a=>a.label == k)[0]['name'] }}</span>
                          </el-col>
                        </div>
                      </el-collapse-item>
                      <el-collapse-item>
                        <template slot="title">
                          <div class="collapse-item-title"><span>车辆材料</span></div>
                        </template>
                        <div v-for="(i, k) in item.lastAttrsList"
                             :key="k">
                          <el-col class="checkbox-item"
                                  :span="4"
                                  v-if="productMaterial.carLender.some(a=>a.dataAttrId== JSON.parse(i).dataAttrId)">
                            <span>{{ productMaterial.carLender.filter(a=>a.dataAttrId== JSON.parse(i).dataAttrId)[0]['name'] }}</span>
                          </el-col>
                        </div>
                      </el-collapse-item>
                    </el-collapse>
                  </el-col>
                </el-form-item>
                <el-form-item label="放款资料">
                  <el-col :span="22">
                    <el-collapse accordion>
                      <el-collapse-item>
                        <template slot="title">
                          <div class="collapse-item-title"><span>放款资料</span></div>
                        </template>
                        <div v-for="(i, k) in item.afterLoanAttrsList"
                             :key="k">
                          <el-col class="checkbox-item"
                                  :span="4"
                                  v-if="productMaterial.afterLoanLender.some(a=>a.dataAttrId== JSON.parse(i).dataAttrId)">
                            <span>{{ productMaterial.afterLoanLender.filter(a=>a.dataAttrId== JSON.parse(i).dataAttrId)[0]['name'] }}</span>
                          </el-col>
                        </div>
                      </el-collapse-item>
                    </el-collapse>
                  </el-col>
                </el-form-item>
                <el-form-item label="抵押材料">
                  <el-col :span="22">
                    <el-collapse accordion>
                      <el-collapse-item>
                        <template slot="title">
                          <div class="collapse-item-title"><span>抵押材料</span></div>
                        </template>
                        <div v-for="(i, k) in item.mortgageAttrsList"
                             :key="k">
                          <el-col class="checkbox-item"
                                  :span="4"
                                  v-if="productMaterial.mortgageLender.some(a=>a.dataAttrId== JSON.parse(i).dataAttrId)">
                            <span>{{ productMaterial.mortgageLender.filter(a=>a.dataAttrId== JSON.parse(i).dataAttrId)[0]['name'] }}</span>
                          </el-col>
                        </div>
                      </el-collapse-item>
                    </el-collapse>
                  </el-col>
                </el-form-item>
              </el-form>
            </el-tab-pane>
          </el-tabs>
        </el-col>
      </el-row>
      <el-row :gutter="10"
              v-if="productDetail.beneficiary">
        <el-col :span="3">
          <div class="content-title">
            <span>保险单特别约定</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.beneficiary }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10"
              v-if="productDetail.accountTime">
        <el-col :span="3">
          <div class="content-title">
            <span>开户信息</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span v-if="productDetail.accountTime==='1'">预审后</span>
          <span v-if="productDetail.accountTime==='2'">终审后</span>
          <el-col :key="key"
                  v-for="(item, key) in productDetail.accountInfo">
            <span>标题：{{ item.title }}&nbsp;&nbsp;&nbsp;链接：{{ item.url }}&nbsp;&nbsp;&nbsp;备注：{{item.info}}</span>
          </el-col>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>金融产品经理</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.manager }}</span>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="3">
          <div class="content-title">
            <span>金融产品经理手机号</span>
          </div>
        </el-col>
        <el-col :span="19">
          <span>{{ productDetail.managerPhone }}</span>
        </el-col>
      </el-row>
    </div>
    <div class="foot">
      <el-button @click="() => {this.$router.go(-1)}"
                 type="primary">确定</el-button>
    </div>
  </div>
</template>

<style lang="scss">
.checkbox-item {
  border-bottom: 1px solid #ecedf2;
  border-left: 1px solid #ecedf2;
}
.el-col span {
  text-align: left;
}
.upload-video {
  display: inline-block;
  margin: 0 10px 0 5px;
}
.video-avatar {
  width: 325px !important;
  height: 200px !important;
}
</style>

<script>
import '@/style/info.scss'
import picView from '@/components/pic-viewer-up'
import vViewer from '@/components/v-viewer'
import { api } from '@/api'
import { joinArray } from '@/utils/filters'
import { material } from '@/utils/data'
import { isInteger, validatenull } from '@/utils/validate'
import { packageImgList } from '@/utils/imgPackage'
import { HTTPSUCCESS, HTTPDATAFAIL, HTTPPARAMFAIL, HTTPUNKOWNFAIL } from '@/components/constant'

export default {
  data() {
    return {
      loanTabs: [],
      periodTabs: [],
      fileAllList: [],
      videoAllList: [{ explain: 'fuck' }],
      list: [{ explain: 'fuck' }, { explain: 'shit' }],
      dataTabsValue: 0,
      gpsTabValue: 0,
      productMaterial: material,
      productDetail: {}
    }
  },
  props: [
    'productId'
  ],
  activated() {
    this.initialized()
    this.getProductDetail()
  },
  components: { picView, vViewer },
  methods: {
    isInteger,
    joinArray,
    initialized() {
      this.$http.get(api.SYS_PRODUCT_INITIALIZE_MATERIAL, { productId: this.productId }).then(
        res => {
          if (res.code === HTTPSUCCESS) {
            const add = res.data
            if (!validatenull(this.productId)) {
              const modifier = JSON.parse(JSON.stringify(material))
              modifier.mainLender.splice(modifier.mainLender.length - 1, 0, ...add.addMainLender)
              modifier.mateLender.splice(modifier.mateLender.length - 1, 0, ...add.addMateLender)
              modifier.guarantorLender.splice(modifier.guarantorLender.length - 1, 0, ...add.addGuarantorLender)
              modifier.guarantorMateLender.splice(modifier.guarantorMateLender.length - 1, 0, ...add.addGuarantorMateLender)
              modifier.carLender.splice(modifier.carLender.length - 1, 0, ...add.addCarLender)
              modifier.afterLoanLender.splice(modifier.afterLoanLender.length - 1, 0, ...add.addAfterLoanLender)
              modifier.mortgageLender.splice(modifier.mortgageLender.length - 1, 0, ...add.addMortgageLender)
              this.productMaterial = modifier
            }
            this.fileAllList = add.fileAllList
            this.videoAllList = add.videoAllList
          } else {
            this.$msg._message('查询失败 请联系系统管理员', 'error')
          }
        }
      )
    },
    getProductDetail() {
      this.$http._get(api.SYS_PRODUCT_DETAIL, this.productId).then(
        res => {
          if (res.code === HTTPSUCCESS) {
            const detail = res.data
            this.loanTabs = detail.loanTabs
            this.gpsTabs = detail.gpsTabs || []
            this.periodTabs = detail.periodTabs || [{}]
            detail.fileAllList.map(e => { e.name = e.filePath.substring(e.filePath.lastIndexOf('/') + 1) })
            this.fileAllList = detail.fileAllList || []
            this.videoAllList = detail.videoAllList || []
            detail.advantage = detail.advantages.join(',')
            this.productDetail = detail
            if (detail.process) {
              const list = []
              const a = detail.process.split('&')
              a.forEach(e => {
                const b = e.split(';')
                list.push({ label: b[0], mark: b[1] })
              })
              this.productDetail.processList = list
            }
          } else {
            this.$msg._message('查询失败 请联系系统管理员', 'error')
          }
        }
      )
    },
    showImg(url) {
      this.$refs.view.showImg(url)
    }
  }
}
</script>
